<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
// API 模板文件，可以复制
namespace api\resource\controller;

use think\Db;
use think\Request;
use think\Validate;
use cmf\controller\RestBaseController;

class Biao18Controller extends RestBaseController
{


    public function one($data)
    {

        //查 这个表的数据
        @$new_data = $data[0]['content'];
        if (empty($new_data)) {
            return '';
        }
//        dump($new_data);
        @$text5 = $new_data->text5;

        @$text5 = json_decode($text5);

       $html = '
            <div style="width: 650px;margin: 0 auto;">
                <div style="font-size: 16px;font-weight: 600;margin-bottom: 15px;">五、主承担单位及参与单位分工及经费分配情况</div>
                <table border="1" cellspacing="0px" cellpadding="5px" width="650">
                    <tbody>
                    <tr>
                        <td>*承担单位（名称及盖章）</td>
                        <td colspan="4">'.@$new_data->text1.'</td>
                    </tr>
                    <tr>
                        <td>*工作分工</td>
                        <td colspan="4">'.@$new_data->text2.'</td>
                    </tr>
                    <tr>
                        <td>经费预算分配情况</td>
                        <td>*新增经费分摊</td>
                        <td>'.@$new_data->text3.'</td>
                        <td>*省科技厅经费分配</td>
                        <td>'.@$new_data->text4.'</td>
                    </tr>
                    ';
                    $i = 1;
                    foreach (@$text5 as $v) {
                        $html .='
                                <tr>
                                    <td>*参与单位'.@$i.'（名称及盖章）</td>
                                    <td colspan="4">'.@$v->text1.'</td>
                                </tr>
                                <tr>
                                    <td>*工作分工</td>
                                    <td colspan="4">'.@$v->text2.'</td>
                                </tr>
                                <tr>
                                    <td>经费预算分配情况</td>
                                    <td>*新增经费分摊</td>
                                    <td>'.@$v->text3.'</td>
                                    <td>*省科技厅经费分配</td>
                                    <td>'.@$v->text4.'</td>
                                </tr>
                                ';
                        @$i++;
                    }


                    $html .='
                    </tbody>
                </table>
            </div>
            ';

            return $html;

    }



}
